﻿@model Gfw.Web.Models.Account.CashModel
@{
    ViewBag.Title = "申请话费";
    Layout = "~/Views/Shared/_LayoutContent.cshtml";
}

<h3 style="color: Red">友情提示：请于周一至周五8：00 -- 16:00完成TX需求，周六周日停止TX，谢谢合作！
</h3>

@using (Html.BeginForm())
{
    @Html.HiddenFor(model => model.Balance)
    @Html.HiddenFor(model => model.UserID)
    @Html.HiddenFor(model => model.BankAddress)
    @Html.HiddenFor(model => model.BankCardNo)
    @Html.HiddenFor(model => model.BankName)
    @Html.HiddenFor(model => model.BankUserName)
    @Html.HiddenFor(model => model.Alipay)
    @Html.HiddenFor(model => model.TenPay)
    
    <h4>
        @Html.DisplayNameFor(model => model.Balance)
        ：
        
        @if (Model.Balance < 100)
        {
            <span style="color: Red">
                @Html.DisplayFor(model => model.Balance)
            </span>
        }
        else
        {
            <span style="color: Green">
                @Html.DisplayFor(model => model.Balance)
            </span>
        }
    </h4>
    
    
    <h4>请选择TX方式：</h4>
    <div>
        @{
        if (string.IsNullOrWhiteSpace(Model.BankName) ||
            string.IsNullOrWhiteSpace(Model.BankCardNo) ||
            string.IsNullOrWhiteSpace(Model.BankUserName))
        {
            @Html.RadioButton("transferInfo", "Bank", new { disabled = "disabled" })
            @Html.ActionLink("【去完善资料】", "ChangeUserBindingInfo", "User")
        }
        else
        {
            @Html.RadioButton("transferInfo", "Bank")
            @Html.DisplayNameFor(model => model.BankName) 
            @: :
            @Html.DisplayFor(model => model.BankName)

            <br />
            @Html.DisplayNameFor(model => model.BankCardNo) 
            @: :
            @Html.DisplayFor(model => model.BankCardNo)

            <br />
            @Html.DisplayNameFor(model => model.BankUserName) 
            @: :
            @Html.DisplayFor(model => model.BankUserName)
        }
        }
    </div>
    
    <div>
        @{
        if (string.IsNullOrWhiteSpace(Model.TenPay) ||
            string.IsNullOrWhiteSpace(Model.BankUserName))
        {
            @Html.RadioButton("transferInfo", "Tenpay", new { disabled = "disabled" })
            @Html.ActionLink("【去完善资料】", "ChangeUserBindingInfo", "User")
        }
        else
        {
            @Html.RadioButton("transferInfo", "Tenpay")
            @Html.DisplayNameFor(model => model.TenPay) 
            @: :
            @Html.DisplayFor(model => model.TenPay)
        }
        }
    </div>
    
    <div>
        @{
        if (string.IsNullOrWhiteSpace(Model.Alipay) ||
            string.IsNullOrWhiteSpace(Model.BankUserName))
        {
            @Html.RadioButton("transferInfo", "Alipay", new { disabled = "disabled" })
            @Html.ActionLink("【去完善资料】", "ChangeUserBindingInfo", "User")
        }
        else
        {
            @Html.RadioButton("transferInfo", "Alipay")
            @Html.DisplayNameFor(model => model.Alipay) 
            @: :
            @Html.DisplayFor(model => model.Alipay)
        }
        }
    </div>
    
    <br />
    <div class="display-label">
        @Html.DisplayNameFor(model => model.Count)
    </div>
    <div class="display-field">
        @Html.TextBoxFor(model => model.Count)
        <span style="color: Red">
            @Html.DisplayName("注：只能TX 100 的整数倍！")
            <br />
        </span>
        @Html.ValidationMessageFor(m => m.Count)
    </div>
    
    
    @Html.ValidationSummary(true)

        if (Model.Balance >= 100 && DateTime.Today.DayOfWeek != DayOfWeek.Saturday &&
            DateTime.Today.DayOfWeek != DayOfWeek.Sunday && DateTime.Now.Hour >= 8 &&
            DateTime.Now.Hour <= 16)
        {
    <input type="submit" value="话费申请" /> @: | 
        }
        
        
        @Html.ActionLink("查看TX明细", "CashQuery", "UserAccount")
}
